package com.lixinyue.array;

public class Demo07 {
    public static void main(String[] args) {
        int[]arr=new int[]{-2,44,12,45,78,-89,111,23};
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length-1-i; j++) {
                if(arr[j]>arr[j+1])
                {
                    int tmp=0;
                    tmp=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=tmp;
                }
            }

        }
        for (int j = 0; j < arr.length; j++) {
            System.out.print(arr[j]+"  ");
        }
    }
}
